local joy__huxiao = fk.CreateSkill {

  name = "joy__huxiao",

  tags = { Skill.Compulsory, },

}



joy__huxiao:addEffect(fk.Damage, {
  name = "joy__huxiao",
  anim_type = "offensive",
  events = {fk.Damage},
  frequency = Skill.Compulsory,
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(joy__huxiao.name) and player == target and data.damageType == fk.FireDamage and not data.to.dead
  end,
  on_use = function(self, event, target, player, data)
    if data.to.dead then return end
    local mark = data.to:getTableMark("@@joy__huxiao-turn")
    table.insertIfNeed(mark, player.id)
    player.room:setPlayerMark(data.to, "@@joy__huxiao-turn", mark)
  end,
})

joy__huxiao:addEffect("targetmod", {
  name = "#joy__huxiao_targetmod",
  bypass_times = function(self, player, skill, scope, card, to)
    return table.contains(to:getTableMark( "@@joy__huxiao-turn"), player.id)
  end,
})

return joy__huxiao